home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / gem / l_0399 / 17 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  3.7 KB

  1. Subject: Re: Colour. 
  2. Date: Mon, 30 May 94 14:26:07 +0100
  3. From: sjg
  4. X-Mts: smtp
  5. Precedence: bulk
  6.  
  7.  
  8. > As I see it, the major issues with colour palette handling by GEM
  9. > programs are:
  10. >     - The standard 16 colours
  11. >         - They're different under MultiTOS (right?)
  12. >         - When should a program desire to change them?
  13.  
  14. Basically I think you've got it right below.
  15.  
  16. >         - When should a user desire to change them?
  17.  
  18. I don't see this as our concern - if a user wishes to change the colours,
  19. let him/her. Presumably (s)he has a good reason to do it...
  20.  
  21. >     - Sharing colours
  22. >         - No point each program allocating its own Purple
  23. >         - When colours must be changed, it would be nice for
  24. >            the actual palette change to be minimized (eg. purple
  25. >            changes to dark purple, not green)
  26.  
  27. The problem here is that GEM (unlike X) has no concept of shared colourmaps.
  28. All colour resources are global. This is a pity, but I can't see Atari doing
  29. anything about it. They could add the functionality to MultiTOS though.
  30. (eg: send a WM_REMAPCOLS on a window change)
  31.  
  32. >     - True Colour emulations
  33. >         - Some programs use a 5x5x5 or 6x6x6 colourspace, and
  34. >            these should all be the same space.
  35.  
  36. Perhaps we need the equivalent of Visuals on a app-by-app basis. So an app
  37. could register its intent to use a 'type' of colourmap. So if we support
  38. 6x6x6 as PSEUDOTRUE, a STANDARD     256 and 16-entry (depending on display depth)
  39. colourmap, and a PRIVATE 256 & 16-entry colourmap, any app could know what
  40. type of colourmap is currently selected, and on receiving WM_TOPPED, could set
  41. its own colourmap if necessary.
  42.  
  43. You'd end up with:
  44.  
  45. main()
  46.     {
  47.     char cmsPresent =0;
  48.  
  49.     app = appl_init();
  50.     if (getCookie("GCMS")) /* Gem Colour Management System */
  51.         {
  52.         cmsPresent = 1;
  53.         cmsRegister(PRIVATE);
  54.         cmsSetPalette(depth, uchar *R, uchar *G, uchar *B);
  55.         cmsChangePalette();
  56.         }
  57.  
  58.     ...
  59.  
  60.     in event loop:
  61.  
  62.     case WM_TOPPED:
  63.         if (cmsPresent && (cmsGetCurrent() != colourMyType() ))
  64.             cmsChangePalette();
  65.         ...
  66.         break;
  67.  
  68.     case WM_UNTOPPED:    /* At last - a use for it!    */
  69.         cmsSetStandardPalette();
  70.         break;
  71.     ...
  72.  
  73.     /* Handle iconify similarly                */
  74.  
  75.  
  76. Of course, the main drawback is that no current apps will support this, but
  77. since there isn't already a standard, I don't see that anything could get
  78. around this.
  79.  
  80. I think the main problem is trying to take a colour allocation 'system' that
  81. was designed for a single-tasking environment and making it work in a multi-
  82. tasking environment. In that vein, I think the way we ought to go about it is
  83. to add functionality when something happens that couldn't have happened in the
  84. old system, ie: when a new app is topped. 
  85.  
  86. You could watch for 'mouse entering window', but to be honest, I fins that a
  87. pain on the X display. If you have a toolbar, and an image, assume that 
  88. they're not joined together, then every time you select a tool the window 
  89. colours go
  90. mad. (I'm thinking of the X application Tgif :-)
  91.  
  92. The DSP decoder from Brainstorm works in the change-on-Topped fashion, and that
  93. works well. I showed it to friends who also use X and "5 out of 5 friends said
  94. that they preferred it" - but cattomeat Today (damn! - getting carried away :-)
  95.  
  96. I'm dubious about whether changing on manipulation is a good idea. I suppose it
  97. is, but it makes implementation more difficult. If a user really needs to see
  98. the desktop files in C:\apps and the colours aren't letting him, then a click 
  99. on
  100. the window should restore all.
  101.             
  102. A program (GEMCMS.PRG) in the auto folder could register the cookie, and
  103. reserve mem for (say) 30 apps. Have a .cpx that llows you to configure this on
  104. the fly, and then you just need binding support (libgem.olb could incorporate
  105. it easily, lattice/pure/any other may have more difficulty - for these a 
  106. separate lib may be necessary.)
  107.  
  108. So what have I missed / how is it inadequate ?
  109.  
  110. Simon.
  111.  
  112.